package Value类型

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object glom {

    def main(args: Array[String]): Unit = {

        val config: SparkConf = new SparkConf().setMaster("local[*]").setAppName("WordCount")

        val sc = new SparkContext(config)

        val rdd = sc.parallelize(1 to 16, 4)

        val glomRDD: RDD[Array[Int]] = rdd.glom()

        glomRDD.collect().foreach(array => {
            for (elem <- array)
                println(elem)
        })

        println()

        glomRDD.collect().foreach(array => {
            println(array.mkString(" "))
        })


    }

}
